package com.android.yummycookies.loader;

import com.android.yummycookies.asyncTask.LoadBitmapThread;
import com.android.yummycookies.model.theme.Theme;
import com.android.yummycookies.service.storer.imagesStorer.binder.BitmapsStoreBinder;

import android.app.Activity;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.View;

public class SimpleThemeLoader extends AbstractLoader {

	private Theme theme;
	private int widthToScale;
	private int heightToScale;
	
	public SimpleThemeLoader(Activity activity,
			BitmapsStoreBinder bitmapsStore, View loadingScreen,
			Theme theme, int widthToScale, int heightToScale) {
		super(activity, bitmapsStore, loadingScreen);

		this.theme = theme;
		this.widthToScale = widthToScale;
		this.heightToScale = heightToScale;
	}

	@Override
	public Handler createObserver() {
		return new Handler(Looper.getMainLooper()) {
			@Override
			public void handleMessage(Message msg) {
				switch (msg.what) {
				case LoadBitmapThread.END_LOADING_BITMAPS:
					getBitmapsStore().add
					getBitmapsStore().scaleAllScaledBitmaps(theme.getScalableBitmapsId(), heightToScale, widthToScale);
				break;
				case sca:
					getThemeStore().addCookieTypes(heightToScale, widthToScale,
							theme.getElemTypes());
					break;
				default:
					break;
				}
			}
		};
	}

	@Override
	public void load() {
		getBitmapsStore().loadAllBitmaps(theme.getBitmapsId());
	}

	

}
